INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/IfcGears/src)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/IfcGears2Osg/src)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${OPENSCENEGRAPH_INCLUDE_DIRS})


# add QT modules
SET(QT_USE_QTMAIN TRUE)
SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTNETWORK TRUE)

# setup QT_LIBRARIES
INCLUDE(${QT_USE_FILE})

# .cxx sources
SET(ifcgearsViewer_CXX_SRC
src/ifcgearsViewer/gui/MainWindow.cpp
src/ifcgearsViewer/gui/StepHighlighter.cpp
src/ifcgearsViewer/gui/TabReadWrite.cpp
src/ifcgearsViewer/gui/TabTextEdit.cpp
src/ifcgearsViewer/gui/TabView.cpp
src/ifcgearsViewer/viewer/CameraMan3D.cpp
src/ifcgearsViewer/viewer/ViewerWidget.cpp
src/ifcgearsViewer/IfcGearsSystem.cpp
src/ifcgearsViewer/CommandManager.cpp
src/ifcgearsViewer/Command.cpp
src/ifcgearsViewer/CmdRemoveSelectedObjects.cpp
src/ifcgearsViewer/main.cpp
)

# files that need to be moc'd by Qt
SET(ifcgearsViewer_MOC_SRC
src/ifcgearsViewer/IfcGearsSystem.h
src/ifcgearsViewer/gui/MainWindow.h
src/ifcgearsViewer/gui/TabReadWrite.h
src/ifcgearsViewer/gui/StepHighlighter.h
src/ifcgearsViewer/gui/TabView.h
src/ifcgearsViewer/gui/TabTextEdit.h
src/ifcgearsViewer/viewer/ViewerWidget.h
)

SET(ifcgearsViewer_RESOURCES
Resources/ifcgears.qrc
)
MESSAGE(${OPENSCENEGRAPH_LIBRARIES})

# moc the headers using Qt listed above and append to cxx sources
QT4_WRAP_CPP(ifcgearsViewer_CXX_SRC ${ifcgearsViewer_MOC_SRC})
QT4_ADD_RESOURCES(ifcgearsViewer_CXX_SRC ${ifcgearsViewer_RESOURCES})

# build the binaries
MESSAGE( WARNING "Must set the location of OSGQT_LIBRARY manually, otherwise the viewer will not compile. FindOpenSceneGraph does not yet find it automatically. OpenSceneGraph >= 3.0.0 is required to build the viewer.")
IF(UNIX)
	SET(OSGQT_LIBRARY libosgQt.lib CACHE FILEPATH "OSG_QT_LIBRARY")
ENDIF(UNIX)
IF(UNIX)
	SET(OSGQT_LIBRARY libosgQt.so CACHE FILEPATH "OSG_QT_LIBRARY")
ENDIF(UNIX)

# ADD_LIBRARY(ifcgearsViewer STATIC ${ifcgearsViewer_CXX_SRC})
ADD_EXECUTABLE(ifcgearsViewer ${ifcgearsViewer_CXX_SRC} )
TARGET_LINK_LIBRARIES(ifcgearsViewer ifcgears2osg ifcgears ${QT_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES} ${OSGQT_LIBRARY} )
